﻿
namespace Inovout.Security
{
    /// <summary>
    /// 没有适用的用户，通常是没有通过认证就访问系统的用户。
    /// </summary>
    internal sealed class NotApplicableUser:IUser
    {
        /// <summary>
        /// 用户名
        /// </summary>
        private const string userName="N/A";
        /// <summary>
        /// 用户名
        /// </summary>
        public string Name
        {
            get { return userName; }
        }
        /// <summary>
        /// 采用单例模式
        /// </summary>
        private static readonly NotApplicableUser instance = new NotApplicableUser();
        /// <summary>
        /// 单例模式
        /// </summary>
        private NotApplicableUser()
        {
        }

        /// <summary>
        /// 唯一实例
        /// </summary>
        internal static NotApplicableUser Instance
        {
            get { return instance; }
        }

        public System.Security.Principal.IIdentity Identity
        {
            get { throw new System.NotImplementedException(); }
        }

        public bool IsInRole(string role)
        {
            throw new System.NotImplementedException();
        }
    }
}
